package de.slothsoft.wasbinich.core.database;

import java.util.MissingResourceException;
import java.util.ResourceBundle;

final class Messages {

    private static final String BUNDLE_NAME = "de.slothsoft.wasbinich.core.database.messages"; //$NON-NLS-1$

    public static String getString(Enum<?> e) {
	try {
	    String key = e.getClass().getSimpleName() + "." + e.name(); //$NON-NLS-1$
	    return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
	} catch (MissingResourceException exception) {
	    return e.name();
	}
    }

    private Messages() {
	// hide class
    }

}
